---
title: Retriever
---

A retriever in LlamaIndex is what is used to fetch `Node`s from an index using a query string.

- [VectorIndexRetriever](/typescript/framework-api-reference/classes/vectorindexretriever/) will fetch the top-k most similar nodes. Ideal for dense retrieval to find most relevant nodes.
- [SummaryIndexRetriever](/typescript/framework-api-reference/classes/summaryindexretriever/) will fetch all nodes no matter the query. Ideal when complete context is necessary, e.g. analyzing large datasets.
- [SummaryIndexLLMRetriever](/typescript/framework-api-reference/classes/summaryindexllmretriever/) utilizes an LLM to score and filter nodes based on relevancy to the query.
- [KeywordTableLLMRetriever](/typescript/framework-api-reference/classes/keywordtablellmretriever/) uses an LLM to extract keywords from the query and retrieve relevant nodes based on keyword matches.
- [KeywordTableSimpleRetriever](/typescript/framework-api-reference/classes/keywordtablesimpleretriever/) uses a basic frequency-based approach to extract keywords and retrieve nodes.
- [KeywordTableRAKERetriever](/typescript/framework-api-reference/classes/keywordtablerakeretriever/) uses the RAKE (Rapid Automatic Keyword Extraction) algorithm to extract keywords from the query, focusing on co-occurrence and context for keyword-based retrieval.
- [Bm25Retriever](/typescript/framework-api-reference/classes/bm25retriever/) uses the BM25 algorithm to extract keywords from the query and retrieve relevant nodes based on keyword matches.

```typescript
const retriever = vectorIndex.asRetriever({
  similarityTopK: 3,
});

// Fetch nodes!
const nodesWithScore = await retriever.retrieve({ query: "query string" });
```
